package 剑指offer_leetcode;

/**
 * JZ11旋转数组的最小数字
 */
public class 剑指Offer11_旋转数组的最小数字 {
    public int minArray(int[] numbers) {
        int left = 0;
        int right = numbers.length-1;
        while(left<=right){
            int mid = (left+right) / 2;
            if(numbers[mid]>numbers[right])
                left = mid + 1;
            else if(numbers[mid]<numbers[right])
                right = mid;
            else
                right--;
        }
        return numbers[left];
    }
}
